package net.oov.identify.model;

public class FreqModel extends CheckModelAdapter{

	private Integer minFreq;
	private Integer minFreqWhole;
	private int valueBuffered;
	
	public FreqModel(Integer minFreq) {
		super();
		this.minFreq = minFreq;
	}
	
	public FreqModel(Integer minFreq, Integer minFreqWhole) {
		
		super();
		this.minFreq = minFreq;
		this.minFreqWhole = minFreqWhole;
		
	}

	public Double value(StatusNode ct, CharSequence cs) {
		return ct.freq().doubleValue();
	}

	public Boolean check(StatusNode ct, CharSequence cs) {
		Integer freq = ct.freq();
		valueBuffered = freq;
		Boolean ret = freq >= minFreq;
		if(ret && minFreqWhole!=null){
			ret = ct.freqWhole() >= minFreqWhole;
		}
		return ret;
	}

	public Integer minFreq(){
		return this.minFreq;
	}

	public int value(){
		return this.valueBuffered;
	}

	public static void wl(Object s){
		System.out.println(s);
	}

	public String info(StatusNode ct, CharSequence cs) {
		// TODO Auto-generated method stub
		return null;
	}
	
	
}
